home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Gooey1.3.1 / C++ Templates / ModalDialog.c < prev    next >
Text File  |  1993-12-29  |  4KB  |  167 lines

  1. $$Loop ModalDialogs
  2. $$Message User Modal Dialog, u:$Worksheet.name$.cp
  3.  
  4. $$File u:$Worksheet.name$.cp
  5. /*  $Worksheet.name$                                 Handle this dialog */
  6. /*  $CopyRight$ */
  7.  
  8. /*    File name:  $Worksheet.name$
  9.     Function:  Handle this modal dialog.
  10.  
  11.     This dialog is called when:
  12.  
  13.     History: $Date$ Original by $Author$
  14.  
  15. */
  16.  
  17. #include "mmCommon$Prototype.name$.h"    /* Common */
  18. #include "Common$Prototype.name$.h"        /* Common */
  19.  
  20. /* ======================================================= */
  21. /* ======================================================= */
  22.  
  23. void CD$Worksheet.name$::Init()
  24. {
  25. inherited::Init();
  26. }
  27.  
  28. $$if Option.EXTRAHOOKS
  29. /* ======================================================= */
  30.  
  31. void CD$Worksheet.name$::ExtraSetup()
  32. {
  33. inherited::ExtraSetup();
  34. }
  35.  
  36. /* ======================================================= */
  37.  
  38. /* Let user handle the item hit */
  39.  
  40. void CD$Worksheet.name$::DoItemHit(short *itemHit,Boolean *ExitDialog)
  41. {
  42. Rect        tempRect;                                /* Temporary rectangle */
  43. short        DType;                                    /* Type of dialog item */
  44. Handle        DItem;                                    /* Handle to the dialog item */
  45. ControlHandle    CItem;                                /* Control handle */
  46. short        temp;                                    /* Get selection, temp holding */
  47.  
  48.  
  49. inherited::DoItemHit(itemHit,ExitDialog);
  50.  
  51. /* NOTE:  Set  *itemHit = 0;    if you want to handle it and not the return code */
  52.  
  53. /* NOTE:  Set  *ExitDialog = true;    if you want to exit the dialog. */
  54.  
  55. if (*itemHit > 0)
  56.     {
  57.     GetDItem(this->theWindow,*itemHit,&DType,&DItem,&tempRect);    /* Get item information */
  58.     CItem = (ControlHandle)DItem;                /* Get the control handle */
  59.  
  60.     $$Loop Control.type = Button
  61.     if (*itemHit == ResD_$Control.name$)                /* Handle the Button being pressed */
  62.         {
  63.         }
  64.  
  65.     $$EndLoop Control.type
  66.     $$Loop Control.type = Checkbox
  67.     if (*itemHit == ResD_$Control.name$)                /* Handle the checkbox being pressed */
  68.         {
  69.         /* Checkbox has NOT been toggled by this call, that happens when it returns */
  70.         if (this->Value_$Control.name$ == 0)
  71.             {
  72.             }
  73.         else
  74.             {
  75.             }
  76.         }
  77.  
  78.     $$EndLoop Control.type
  79.     $$Loop Control.type = UButton
  80.     if (*itemHit == ResD_$Control.name$)                /* Handle the Button being pressed */
  81.         {
  82.         }
  83.  
  84.     $$EndLoop Control.type
  85.     $$Loop Control.type = UToggle
  86.     if (*itemHit == ResD_$Control.name$)                /* Handle the checkbox being pressed */
  87.         {
  88.         /* Checkbox has NOT been toggled by this call, that happens when it returns */
  89.         if (this->Value_$Control.name$ == 0)
  90.             {
  91.             }
  92.         else
  93.             {
  94.             }
  95.         }
  96.  
  97.     $$EndLoop Control.type
  98.     $$Loop Control.type = Radio
  99.     if (*itemHit == ResD_$Control.name$)            /* Handle the Radio being pressed */
  100.         {
  101.         /* Radio has NOT been set by this call, that happens when it returns */
  102.         }
  103.  
  104.     $$EndLoop Control.type
  105.     $$Loop Control.type = HotRect
  106.     $$if Control.HotSpot
  107.     if (*itemHit == ResD_$Control.name$)                /* Handle the HotSpot being pressed */
  108.         {
  109.         }
  110.  
  111.     $$endif Control.HotSpot
  112.     $$EndLoop
  113.     $$Loop Control.type = Picture
  114.     $$if Control.NonGraphic
  115.     if (*itemHit == ResD_$Control.name$)                /* Handle the Picture being pressed */
  116.         {
  117.         }
  118.  
  119.     $$endif Control.NonGraphic
  120.     $$EndLoop
  121.     $$Loop Control.type = Icon
  122.     $$if Control.NonGraphic
  123.     if (*itemHit == ResD_$Control.name$)                /* Handle the Icon being pressed */
  124.         {
  125.         }
  126.  
  127.     $$endif Control.NonGraphic
  128.     $$EndLoop
  129.     $$Loop Control.type = Sicn
  130.     $$if Control.NonGraphic
  131.     if (*itemHit == ResD_$Control.name$)                /* Handle the Sicn being pressed */
  132.         {
  133.         }
  134.  
  135.     $$endif Control.NonGraphic
  136.     $$EndLoop
  137.     }
  138.  
  139. }
  140.  
  141. /* ======================================================= */
  142.  
  143. /* Exit the dialog, get Edit Text values and other settings at this time */
  144.  
  145. void CD$Worksheet.name$::Exit()
  146. {
  147. inherited::Exit();
  148. }
  149.  
  150. /* ======================================================= */
  151.  
  152. /* Update the Dialog */
  153.  
  154. void CD$Worksheet.name$::Refresh()
  155. {
  156. inherited::Refresh();
  157. }
  158.  
  159. $$endif Option.EXTRAHOOKS
  160.  
  161. /* ======================================================= */
  162. /* ======================================================= */
  163. $$CloseFile
  164. $$EndLoop
  165.  
  166.  
  167.